package gam.n1.achievement.n;

import gam.n1.achievement.iAchievement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.Supplier;

public class DoubleAchievement extends BaseAchievement<Double> {

    public DoubleAchievement(@NotNull Supplier<Double> initValue, @Nullable String name) {
        super(initValue, name);
    }

    @Override
    public iAchievement<Double> copy() {
        return new DoubleAchievement(valueF,name);
    }

    @Override
    public Class<Double> t() {
        return Double.class;
    }

    @Override
    public void set(Double aDouble) {
        $t = aDouble >= Double.MAX_VALUE || aDouble <= Double.MIN_VALUE ? 0 : aDouble;
    }
}
